package com.chen.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Set;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo {
    private int id;
    private String type;
    private String userName;
    private String nickName;
    private int age;
    private String sex;
    private String address;
    private String avatar;
    private int role;
    private Set<Permission> permissions;



    public UserInfo(User user) {
        this.id=user.getId();
        this.userName = user.getUsername();
        this.nickName = user.getNick();
        this.age = user.getAge();
        this.sex = user.getSex();
        this.address = user.getAddress();
        this.avatar=user.getAvatar();
        this.type = "cache";
        this.role=user.getRole();
        this.id=user.getId();
        this.permissions=user.getPermissions();
    }
}
